﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using WebServer.Models;

namespace WebServer
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的接口名“IUser”。
    [ServiceContract]
    public interface IUser
    {

        #region 心情逻辑
        /// <summary>
        /// 心情
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        Mood Mood(DateTime Day);
        


        /// <summary>
        /// 心情动作
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="Filed"></param>
        /// <param name="Fn"></param>
        /// <returns></returns>
        [OperationContract]
        bool MoodAction(DateTime Day, string Filed);
       


        #endregion


        #region 分类逻辑

        /// <summary>
        /// 获取分类
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<UCate> Cate( bool IsDel);


        /// <summary>
        /// 获取单个分类
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        UCate CateByID(int ID);


        /// <summary>
        /// 分类动作 Filed == "IsCompany"  || Filed == "IsLive"  || Filed == "IsDel"
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="Filed"></param>
        /// <param name="Fn"></param>
        /// <returns></returns>
        [OperationContract]
        bool CateAction(int ID, string Filed, bool Fn);

        /// <summary>
        /// 更新分类
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        bool CateSet(UCate U);


        #endregion


        #region 会员逻辑

        /// <summary>
        /// 普通会员
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="Email"></param>
        /// <param name="Mobile"></param>
        /// <param name="Name"></param>
        /// <param name="CateID"></param>
        /// <param name="Order"></param>
        /// <param name="Desc"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<User> UserVip(int PageSize, int PageIndex, string Email, string Mobile, string Name, int CateID, int Order, bool Desc, bool IsDel);


        /// <summary>
        /// 普通会员总数
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        int MUserCount(string Email, string Mobile, string Name, int CateID, bool IsDel);

        /// <summary>
        /// 修改用户基本信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract]
        int UpdateUser(User entity);
        
        /// <summary>
        /// 删除会员头像
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        int DelUserface(int ID);

        /// <summary>
        /// 创建会员
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UserInsert(User U);


        /// <summary>
        /// 注册【用户名跟密码】
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UserAdd(User U);
        
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        [OperationContract]
        int UpPassword(int UserID, string PassWord);

        /// <summary>
        /// 获取会员信息
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        User UserByID(int ID);


        
        /// <summary>
        /// 详细的人员信息
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        UserInfo UserInfoByID(int ID = 0);

          /// <summary>
        /// 获取会员信息
        /// </summary>
        /// <param name="Name"></param>
        /// <returns></returns>
        [OperationContract]
        User UserByName(string Name);

        /// <summary>
        /// 登陆
        /// </summary>
        /// <param name="Name"></param>
        /// <param name="Pass"></param>
        /// <param name="IP"></param>
        /// <returns></returns>
        [OperationContract]
        User UserLogin(string Name, string Pass, string IP);


       /// <summary>
       /// 存在账号
       /// </summary>
       /// <param name="Name"></param>
       /// <param name="Type"></param>
       /// <returns></returns>
        [OperationContract]
        int HasUser(string Name,int Type);



        /// <summary>
        /// 会员动作  Filed == "IsDel"  || Filed == "EmailAudit"  || Filed == "MobileAudit" || Filed == "IsOpen" 
        /// </summary>
        /// <param name="Name"></param>
        /// <param name="Pass"></param>
        /// <param name="IP"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UserAction(int ID, string Filed, bool Fn);


        /// <summary>
        /// 更新会员-动作中有的这里不允许更新：@Sex，@CardNO，@Introduce，@Tel，@Address，@Portrait
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UserSet(UserInfo U);


        /// <summary>
        /// 注册会员时-经济商填写信息
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UserBrokerSet(UserBrokerEntity U);

        /// <summary>
        /// 查看申请经济商和分析师账号的详细信息
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        UserBrokerEntity MGetCheckUser(int ID);

        
           /// <summary>
        /// 新建经济商-动作中有的这里不允许更新
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        int UserApplyBroker(UserInfo U);

        /// <summary>
        /// 更新会员单个资料 更新：@Sex，@CardNO，@Introduce，@Tel，@Address，@Portrait
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UserSetOne(int ID,string Filed,string Value);

        /// <summary>
        /// 会员绑定  Filed == "Email"  || Filed == "Mobile" 
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="Filed"></param>
        /// <param name="Val"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UserBind(string Filed, string Val);

        /// <summary>
        /// 已经绑定过得手机或者邮箱，再绑定邮箱或手机
        /// </summary>
        /// <param name="Filed"></param>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UserTwoBind(string Filed, string Val, int ID);

        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="Word"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UserPassWord(string Name, string Code, string Pass);


         /// <summary>
        /// 微信登录
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity WeiXinLogin(string OpenID, string Province, string City, string Sex, string Name, string Portrait, string ip);

        /// <summary>
        /// QQ登录
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="Word"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity QQLogin(string OpenID, string Province, string City, string Sex, string Name, string Portrait, string ip);

        /// <summary>
        /// 微博登录
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="Word"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity WeiboLogin(string OpenID, string Province, string City, string Sex, string Name, string Portrait, string ip);


           /// <summary>
        /// 后團管理人員主動幫用戶改類型
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="CateID"></param>
        /// <returns></returns>
        [OperationContract]
        int ManageCheckUser(int ID, int CateID);


        /// <summary>
        /// 绑定处理
        /// </summary>
        /// <param name="Name"></param>
        /// <param name="Code"></param>
        /// /// <param name="Type"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity BoundUser(int UserID,string Name, string Code,bool Type);

           /// <summary>
        /// 搜索所有的用户
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="Email"></param>
        /// <param name="Mobile"></param>
        /// <param name="Name"></param>
        /// <param name="UserID"></param>
        /// <param name="Order"></param>
        /// <param name="Desc"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<UserFocusEntity> UserOrder(int PageSize, int PageIndex, string Email, string Mobile, string Name, int UserID, int Order, bool Desc, bool IsDel);


        /// <summary>
        /// 判断qq是否被注册过
        /// </summary>
        /// <param name="OpenID"></param>
        /// <returns></returns>
        [OperationContract]
        User UserByQQID(string OpenID);
        #endregion

        #region 审核分析师，经济商
        /// <summary>
        /// 审核分析师，经济商
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="CateName"></param>
        /// <param name="Name"></param>
        /// <param name="Tel"></param>
        /// <param name="Email"></param>
        /// <param name="Address">可以模糊查询</param>
        /// <param name="QQInfo"></param>
        /// <param name="CheckCode"></param>
        /// <param name="Order">默认为时间排序，1-是否审核，2-地址</param>
        /// <param name="Desc"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<CheckUser> CheckUserList(int PageSize, int PageIndex, string CateName, string Name, string Tel, string Email, string Address, string QQInfo, string CheckCode, int Order, bool Desc, bool IsDel);

        /// <summary>
        /// 审核分析师，经济商总数.
        /// </summary>
        /// <param name="CateName"></param>
        /// <param name="Name"></param>
        /// <param name="Tel"></param>
        /// <param name="Email"></param>
        /// <param name="Address"></param>
        /// <param name="QQInfo"></param>
        /// <param name="CheckCode"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        int CheckUserCount(string CateName = "", string Name = "", string Tel = "", string Email = "", string Address = "", string QQInfo = "", string CheckCode = "", bool IsDel = false);


         /// <summary>
        /// 审核
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="IsOpen"></param>
        /// <returns></returns>
        [OperationContract]
        string CheckUser(int ID, bool IsOpen);


          /// <summary>
        /// 根据Id获取申请人的详细信息
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        User CheckUserByID(int ID = 0);

         
        /// <summary>
        /// 审核不通过，添加原因
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="Remark"></param>
        /// <returns></returns>
        [OperationContract]
        int AddRemark(int ID, string Remark);


        /// <summary>
        /// 创建审核
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        MsgEntity CheckInsert(CheckUser U);


           /// <summary>
        /// 后台添加经济商
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract]
        int BrokerSet(User entity);

        /// <summary>
        /// 后台审核经济商申请入驻
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="UserName"></param>
        /// <param name="Province"></param>
        /// <param name="City"></param>
        /// <param name="IsOpen"></param>
        /// <param name="CateID"></param>
        /// <param name="OrderID"></param>
        /// <param name="Desc"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<OpenBourkerEntity> OpenBourkerList(int PageSize, int PageIndex, string UserName, string Province, string City, int IsOpen, int CateID, int OrderID, bool Desc, int IsDel);


        /// <summary>
        /// 后台审核经济商申请入驻
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract]
        int OpenBourkerCount(string UserName, string Province, string City, int IsOpen, int CateID, int IsDel);

            /// <summary>
        /// 审核成功
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        [OperationContract]
        int OpenBroKerSu(int UserID);
        #endregion


        #region 公司逻辑
        /// <summary>
        /// 创建公司
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity CompanyInsert(CompanyEntity U);


        /// <summary>
        /// 公司动作 Filed == "IsDel"  || Filed == "Audit"
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="Filed"></param>
        /// <param name="Fn"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity CompanyAction(int ID, string Filed, bool Fn);

        /// <summary>
        /// 更新公司
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity CompanySet(CompanyEntity U);

        /// <summary>
        /// 获取公司信息
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        [OperationContract]
        CompanyEntity CompanyByID(int UserID);

        /// <summary>
        /// 获取公司排序信息
        /// </summary>
        /// <param name="Filed"></param>
        /// <param name="Page"></param>
        /// <param name="PageSize"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<CompanyEntity> CompanySort(string Filed, int Page, int PageSize, bool Desc, string Compel);



        #endregion


        #region 关注/粉丝
        /// <summary>
        /// 创建关注
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity FocusSet(int UserID, int FocusID,bool IsDel);

        /// <summary>
        /// 关注粉丝列表
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="IsMe"></param>
        /// <returns></returns>
        [OperationContract]
        List<UserFocusEntity> FocusList(int UserID, bool IsMe);

          /// <summary>
        /// 我关注的人，关注我的人
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        [OperationContract]
        List<UserFocusTEntity> FocusFans(int UserID);

       /// <summary>
        /// 已经关注
       /// </summary>
       /// <param name="UserID"></param>
       /// <param name="FocusID"></param>
       /// <returns></returns>
        [OperationContract]
        bool FocusHas(int UserID, int FocusID);


        /// <summary>
        /// 热门吧主
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="UserID"></param>
        /// <param name="Sort">默认根据粉丝数排行，1-时间</param>
        /// <param name="Desc"></param>
        /// <returns></returns>
        [OperationContract]
        List<UserFocusEntity> FocusSort(int PageSize, int PageIndex, int UserID, int Sort, bool Desc);


        #endregion


        #region 私信
        /// <summary>
        /// 创建私信
        /// </summary>
        /// <param name="FromID"></param>
        /// <param name="ToID"></param>
        /// <param name="Text"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity LetterInsert(int FromID, int ToID, string Text);


        /// <summary>
        /// 获取私信
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="UserID"></param>
        /// <returns></returns>
        [OperationContract]
        ULetter LetterByID(int ID,int UserID);

        /// <summary>
        /// 删除私信
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="UserID"></param>
        /// <returns></returns>
        [OperationContract]
        bool LetterDelete(int ID, int UserID);


        /// <summary>
        /// 私信列表
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="IsFrom"></param>
        /// <returns></returns>
        [OperationContract]
        List<ULetter> Letter(int UserID,int Page,int PageSize, bool IsFrom);

          /// <summary>
        /// 手机查询私信列表
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<ULetter> PLetter(int UserID, string OpenTime, string EndTime, int PageSize, bool IsFrom);

        /// <summary>
        /// 阅读私信
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity LetterSet(int ID,int UserID);

        #endregion


        #region 自选
        /// <summary>
        /// 创建自选
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="UserID"></param>
        /// <param name="Code"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity ChooseInsert(int UserID, int CenterID, string Code);

        /// <summary>
        /// 是否已经自选
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="UserID"></param>
        /// <param name="Code"></param>
        /// <returns></returns>
        [OperationContract]
        bool ChooseHas(int UserID, int CenterID, string Code);

        /// <summary>
        /// 删除自选
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="UserID"></param>
        /// <param name="Code"></param>
        /// <returns></returns>
        [OperationContract]
        bool ChooseDelete(int UserID, int CenterID, string Code);

        /// <summary>
        /// 自选列表
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        [OperationContract]
        List<UserCodeEntity> Choose(int UserID);

        /// <summary>
        /// 自选排行
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
         [OperationContract]
        List<Goods> ChooseSort(int Size);
        #endregion


        #region 开户列表
           /// <summary>
        /// 开户列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="UserName"></param>
        /// <param name="CenterID"></param>
        /// <param name="Sort"></param>
        /// <param name="Desc"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
         [OperationContract]
         List<UOpen> OpenList(int PageSize, int PageIndex, string UserName, int CenterID, string Code, int Sort, bool Desc, bool IsDel);

           /// <summary>
        /// 开户总数
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
         [OperationContract]
         int MOpenCount(string UserName, int CenterID, string Code, bool IsDel);

        /// <summary>
        /// 开户列表
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        [OperationContract]
        List<UOpen> Open(int UserID,bool IsDel);



        /// <summary>
        /// 设置开户
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity OpenSet(UOpen U);

          /// <summary>
        /// 删除开户信息
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        int DelOpen(int ID);
        #endregion


        #region 模拟交易
        /// <summary>
        /// 新增交易
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="CenterID"></param>
        /// <param name="Code"></param>
        /// <param name="Amount"></param>
        /// <param name="CurPrice"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity TradInsert(int UserID, int CenterID, string CenterName, string Code, string Name, int Amount, decimal CurPrice, decimal Poundage);


        /// <summary>
        /// 可交易藏品
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        [OperationContract]
        List<TardEntity> TradUsable(int UserID);


        /// <summary>
        /// 交易列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="Page"></param>
        /// <param name="UserID"></param>
        /// <returns></returns>
        [OperationContract]
        List<TardEntity> TradList(int Page, int PageSize, int UserID);

          /// <summary>
        /// 手机查询交易列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="Page"></param>
        /// <param name="UserID"></param>
        /// <returns></returns>
        [OperationContract]
        List<TardEntity> PTradList(string OpenTime, string EndTime, int PageSize, int UserID);
        #endregion


        #region 会员点击排行，会员积分排行
        /// <summary>
        /// 会员点击排行 Filed= Hits || Score
        /// </summary>
        /// <param name="Filed"></param>
        /// <returns></returns>
        [OperationContract]
        List<User> UserSort(string Filed,int Size);

        /// <summary>
        /// 机构排行
        /// </summary>
        /// <param name="Filed"></param>
        /// <returns></returns>
        [OperationContract]
        List<User> OrgSort(string Filed, int Page, int PageSize, string Province, string City);



        
        /// <summary>
        /// 机构排行
        /// </summary>
        /// <param name="Filed"></param>
        /// <param name="CompanyName">可根据公司名模糊查询</param>
        /// <returns></returns>
        [OperationContract]
        List<User> OrgSortByCompany(string Filed, int Page, int PageSize, string Province, string City, string CompanyName);

          /// <summary>
        /// 机构排行
        /// </summary>
        /// <param name="Filed"></param>
        /// <returns></returns>
        [OperationContract]
        List<User> POrgSort(string Filed, string OpenTime, string EndTime, int PageSize, string Province, string City);

        /// <summary>
        /// 根据交易所获取记过
        /// </summary>
        /// <param name="Filed"></param>
        /// <returns></returns>
        [OperationContract]
        List<User> OrgSaerch(string Filed, int Page, int PageSize, int CenterID);

           /// <summary>
        /// 机构排行
        /// </summary>
        /// <param name="Filed"></param>
        /// <returns></returns>
        [OperationContract]
        List<User> POrgSaerch(string Filed, string OpenTime, string EndTime, int PageSize, int CenterID);
        #endregion


        #region 模拟排行，申购日历



        #endregion


        #region 收藏
        /// <summary>
        /// 收藏列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="Page"></param>
        /// <param name="Order"></param>
        /// <param name="UserID"></param>
        /// <param name="BarID"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<Bar> CollBarList(int PageSize, int Page, int Order, int UserID, int BarID, bool IsDel);


         /// <summary>
        /// 手机查询收藏列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="Page"></param>
        /// <param name="Order">根据时间排序</param>
        /// <param name="UserID"></param>
        /// <param name="BarID"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<Bar> PCollBarList(string OpenTime, string EndTime, int PageSize, int Order, int UserID, int BarID, bool IsDel);


        /// <summary>
        /// 收藏邮吧
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract]
        int CollectBar(CollectBar entity);

        /// <summary>
        /// 取消收藏
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        int UnCollect(int barID,int UserId);
        #endregion


        #region 点赞
        /// <summary>
        /// 点赞
        /// </summary>
        /// <param name="usreid"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        [OperationContract]
        int clickCon(int usreid, int id);


        /// <summary>
        /// 取消点赞
        /// </summary>
        /// <param name="usreid"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        [OperationContract]
        int clickNoCon(int usreid, int id);
        #endregion


        #region 活动
        /// <summary>
        /// 活动
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity ActivitySet(Activity U);

        /// <summary>
        /// 活动
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        Activity ActivityByID(int ID);

        /// <summary>
        /// 活动列表
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        List<Activity> Activity(int UserID,int Page,int PageSize);


            /// <summary>
        /// 可根据交易所查询活动列表
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        List<Activity> ActivityByCenter(int UserID, int Page, int PageSize, int CenterID, int Order, bool Desc);

           /// <summary>
        /// 手机查询活动列表
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        List<Activity> PActivity(int UserID, string OpenTime, string EndTime, int PageSize);


        
        /// <summary>
        /// 后台查询活动列表
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        List<Activity> MActivity(int UserID, int Page, int PageSize, int Order, bool Desc);

           /// <summary>
        /// 活动总数
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        int ActivityCount(int UserID);

          /// <summary>
        /// 后台删除活动
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        int DelActivity(int ID);

        /// <summary>
        /// 活动删除
        /// </summary>
        /// <param name="U"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity ActivityDel(int ID, int UserID);

        
        /// <summary>
        /// 活动过期
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="UserID"></param>
        /// <param name="OutDate"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity ActivityOutDate(int ID, int UserID, bool OutDate);


        
        /// <summary>
        /// 活动交易所
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<NewsBourseGroupEntity> BourseGroup();
        #endregion


        #region 分析师

        /// <summary>
        /// 申请绑定
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        MsgEntity Underling(int UID, int UserID);

        /// <summary>
        /// 状态
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UnderlingState(int UID, int UserID);

        /// <summary>
        /// 状态
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<User> UnderlingList(int UID);

        /// <summary>
        /// 更新状态
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UnderlingSet(int ID, int UserID,bool Fn);

         /// <summary>
        /// 分析师列表
        /// </summary>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <param name="Where">邮箱或者手机号</param>
        /// <param name="Order"></param>
        /// <param name="Desc"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<AnalystEntity> AnalystList(int PageIndex, int PageSize, string Where, int UserID, int Order, bool Desc, bool IsDel);

         /// <summary>
        /// 经济商邀请分析师
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UnderlingAdd(int UID, int UserID, int Fn);


         /// <summary>
        /// 通过申请
        /// </summary>
        /// <param name="UID">分析师</param>
        /// <param name="UserID">经济商</param>
        /// <param name="Fn"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UnderlingPass(int ID, int UID, int UserID, int Fn);

         
        /// <summary>
        /// 分析师被谁邀请
        /// </summary>
        /// <param name="Filed"></param>
        /// <returns></returns>
        [OperationContract]
        List<User> UnderlingAnalyst(int UID);
        #endregion


        #region 后台
        [OperationContract]
        MUser MUserLogin(string UserName, string PassWord);


          /// <summary>
        /// 添加日志
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="Detail"></param>
        /// <returns></returns>
        [OperationContract]
        int MLogAdd(int UserID,string Name, string Detail,string Remarl);

        ///// <summary>
        /////修改后台密码
        ///// </summary>
        ///// <param name="UserID"></param>
        ///// <param name="Pwd"></param>
        ///// <param name="NewPwd"></param>
        ///// <returns></returns>
        [OperationContract]
        int MUpdatePwd(int UserID, string Pwd, string NPwd);
        #endregion

        #region 委托
        /// <summary>
        /// 委托
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        [OperationContract]
        List<UserEntrustEntity> UEntrustList(int UserID);


        /// <summary>
        /// 委托
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        [OperationContract]
        List<UStock> UStockList(int UserID);


        /// <summary>
        /// 委托[买]
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UEntrustBuy(UserEntrustEntity entity);


        /// <summary>
        /// 委托-[卖出]
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UEntrustSell(UserEntrustEntity entity);



        /// <summary>
        /// 委托是否完成
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="IsFinish">true-买,false-卖</param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UEntrusStock(int ID, int UserID, bool IsFinish, DateTime CreateTime);
        /// <summary>
        /// 委托完成
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="IsFinish">true-买,false-卖</param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UEntrusStockSuc(int ID, decimal LastPrice, DateTime CreateTime);

        /// <summary>
        /// 删除委托
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity UEntrustDel(int ID);

        /// <summary>
        /// 清空委托表
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        int UEntrusClear();
        #endregion
    }
}
